package net.sansi.v3correctserver.task;

import cn.hutool.core.thread.ThreadUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import net.sansi.v3correctserver.util.Matrix;

/**
 * Created by Fang
 * create time : 2024/11/1
 * IDE : IntelliJ IDEA
 * <p>
 * 亮度矫正任务
 */

@Slf4j
public class ChromaCorrectTask extends V3Task<ChromaCorrectTask, ChromaCorrectTask.CorrectProgress> {

    private Matrix<double[]> result;
    private boolean reusePhoto;

    public ChromaCorrectTask(int areaId, boolean reusePhoto) {
        super(5, new CorrectProgress());
        this.reusePhoto = reusePhoto;
    }

    private double[][] testColor = new double[][]{
            {0.8, 0.1, 0.1},
            {0.1, 0.8, 0.1},
            {0.1, 0.1, 0.8},
    };

    @Override
    void runHandler() {

    }

    private void correct(int ofx, int ofy) {
        for (int colorIdx = 0; colorIdx < 3; colorIdx++) {
            int ci = colorIdx;
            ThreadUtil.sleep(500);
        }
    }

    @Getter
    @Setter
    public static class CorrectProgress extends Progress {
        private double progress = 0;
        //private double[] colorProgresses = new double[]{0, 0, 0};
    }
}
